unit JATUIF_Component_Background;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, JATUIF_Driver_Screen, JATUIF_Component;

Type

    { TLabel }

    TBackground = class(TComponent)
      Protected
        Procedure _OnMouseEnter; override;
        Procedure _OnMouseLeave; override;
        Procedure _OnClick; override;
        Procedure Draw; override;
      Private
        Background_Char:Char;
        Background_Foreground_Color:Byte;
        Background_Color:Byte;
      Public
        Constructor Create(Parent:TScreen; Character:Char; Foreground_Color:Byte; Color:Byte);
    end;

implementation

{ TLabel }

procedure TBackground._OnMouseEnter;
begin
     inherited _OnMouseEnter;
end;

procedure TBackground._OnMouseLeave;
begin
     inherited _OnMouseLeave;
end;

procedure TBackground._OnClick;
begin
     inherited _OnClick;
end;

procedure TBackground.Draw;
var
   i,n:integer;

begin
     For i:=1 to 25 do begin
         For n:=1 to 80 do begin
             Screen.DrawCharXY(GetTag,n,i,Background_Char,Background_Foreground_Color,Background_Color);
         end;
     end;
     SendToBack;
end;

constructor TBackground.Create(Parent: TScreen; Character: Char; Foreground_Color: Byte; Color: Byte);
begin
     Background_Char:= Character;
     Background_Foreground_Color:= Foreground_Color;
     Background_Color:= Color;
     inherited Create(Parent,1,1,80,25);
end;

end.

